﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
using Interpreter;

namespace Test
{
	class TestInterpreter
	{
		static void Main(string[] args)
		{
			Interpreter.StringInterpreter interpreter = new Interpreter.StringInterpreter();
			//string zellePaul = "Mensch(name:string, alter:Double, geschlecht:string, wohnort:string)";
			string tod = "Tod()";
			string lebendig = "Lebendig()";

			string einsamkeit = "Lebendig(Lebendig<3 or Umgebung: Tod>5)";


			try
			{
				interpreter.initializeZelle(tod);
				interpreter.initializeZelle(lebendig);
				interpreter.initializeEnvironment();
				Cell todCell = new Cell();
				todCell.init(interpreter.Zellen["Tod"]);

				Expression expr = interpreter.evaluateRuleExpression(einsamkeit);
				expr.evaluate(todCell);

			}
			catch (Exception e)
			{
				Console.WriteLine(e.ToString());
			}
		}
	}
}
